<?php
$this->_var['repaycss'][] = $this->_var['TMPL_REAL']."/css/datepicker.css";
$this->_var['repayjs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.core.js";
$this->_var['repayjs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.widget.js";
$this->_var['repayjs'][] = $this->_var['TMPL_REAL']."/js/jquery.ui.datepicker.js";
?>
<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$repaycss"}" />
<script type="text/javascript" src="{function name="parse_script" v="$repayjs" c="$repayjs"}"></script>
<script type="text/javascript">
jQuery(function(){
	$("#time_normal").datepicker({showAnim:'fadeIn'});
	
	$("#qiehuan").click(function(){
		if ($(".sub_nav .cc").hasClass('hide')) {
			$(".sub_nav .cc").removeClass("hide")
			$(".sub_nav .bb").addClass("hide");
     	 }else{
     		$(".sub_nav .cc").addClass("hide");
     		
     		$(".sub_nav .bb").removeClass("hide")
     	 };
     	 
     	 if($.trim($(this).html()) == "切换简单查询" )
   		 {
		 	$("#time_status").val(0);
   			$(this).html("切换高级查询");
   		 }
     	 else
  		 {
		 	$("#time_status").val(1);
  			$(this).html("切换简单查询");
  		 }
     	
	});
	
	$("#search-form").submit(function(){
		var val= $("#time_normal").val();
		$("#time_format").val(val.replace(/-/g,""));
	});
	
	
});
</script>
<style>
.select_btn {
    font-size: 12px;
    font-weight: bold;
    height: 28px;
    line-height: 28px;
}
.uc-table table{
	font-size:14px;
}

</style>
<div class="uc_r_bl">
	<div class="inc_main">
		<div class="list_title clearfix">
			<div {if $ACTION_NAME eq 'index'}class="cur"{/if}>
				<a href="{url x="index" r="uc_money#index"}">{$LANG.UC_LOGS}</a>
			</div>
			<div {if $ACTION_NAME eq 'incharge'}class="cur"{/if}>
				<a href="{url x="index" r="uc_money#incharge"}">{$LANG.UC_MONEY_INCHARGE}</a>
			</div>
			<div {if $ACTION_NAME eq 'incharge_log'}class="cur"{/if}>
				<a href="{url x="index" r="uc_money#incharge_log"}">{$LANG.UC_MONEY_INCHARGE_LOG}</a>
			</div>
			<div {if $ACTION_NAME eq 'carry'}class="cur"{/if}>
				<a href="{url x="index" value="uc_money#carry"}">{$LANG.UC_CARRY}</a>
			</div>
			<div {if $ACTION_NAME eq 'carry_log'}class="cur"{/if}>
				<a href="{url x="index" value="uc_money#carry_log"}">提现日志</a>
			</div>
		</div>
		<div class="uc_r_bl_box clearfix">
			<div class="balance p20 m10">
				<div class="balance_l">
					<p class="f20">账户余额</p>
					<span class="J_u_money_1">
					<span class="f_red f16"><?php echo format_price($this->_var['user_info']['money'] + $this->_var['user_info']['lock_money']); ?><em class="f14">元</em></span>
					</span>
				</div>	
				<div class="balance_r pl10">
					<ul>
						<li class="first">
							<div>
								<p class="f16">可用资金</p>
								<span class="J_u_money_0"><span class="f_red">{function name="format_price" v=$user_info.money}</span></span>
							</div>
							<div class="tl">
								<p calss="f16">已充值总额</p>
								<span>{if $incharge_money}{function name="format_price" v=$incharge_money}{else}0.00{/if}</span>
							</div>
							<div class="inchange_box tr">
								<a href="{url x="index" r="uc_money#incharge"}" class="true_btn" style="display:inline-block;background:#FF4E00">充值</a>
							</div>
						</li>
						<li>
							<div>
								<p class="f16">冻结资金</p>
								<span class="J_u_money_2"><span>{function name="format_price" v=$user_info.lock_money}</span></span>
							</div>
							<div class="tl">
								<p calss="f16">已提现总额</p>
								<span>{if $carry_money}{function name="format_price" v=$carry_money}{else}0.00{/if}></span>
							</div>
							<div class="inchange_box tr">
								<a href="{url x="index" r="uc_money#bank"}" class="true_btn" style="display:inline-block">提现</a>
							</div>
						</li>
					</ul>
				</div>	
			</div>
			<div class="blank0"></div>

			<div class="list_title bt1">
				<div {if $t eq ''}class="cur"{/if}><a href="{url x="index" r="uc_money#index"}">资金日志</a></div>
				<div {if $t eq 'lock_money'}class="act"{/if}><a href="{url x="index" r="uc_money#index" p="t=lock_money"}">冻结金额日志</a></div>
				<div {if $t eq 'point'}class="act"{/if}><a href="{url x="index" r="uc_money#index" p="t=point"}">信用积分日志</a></div>
			</div>
		
			<div class="nav">
				<form method="get" action="{$APP_ROOT}" id="search-form" name="search">  		
					<div class="sub_nav">
						<div class="aa f_l">
							查询类型：
							<select name="type_title">
							{foreach from=$title_array item="item" key=key }
								<option {if $type_title eq $key}selected="selected"{/if} value="{$key}">
									{$item}
								</option>
							{/foreach}			
							</select>
						</div>
						<div class="cc pl10 {if $time_status eq 1}hide {/if} f_l">
							查询时间：
			                <select  name="times">
			                {foreach from=$times_array item="item" key=key }
			                  <option  {if $times eq $key}selected="selected"{/if} value="{$key}">{$item}</option>
			               	{/foreach}	
			                </select>
				         </div>
						<div class="bb pl10 {if $time_status eq 0}hide {/if} f_l">
							查询时间：<input class="f-input f_input" id="time_normal" type="text" value="{$time_normal}">
							<input type="hidden" name="time" id="time_format" value="{$time}">
						</div>
						<input type="hidden" name="ctl" value="{$MODULE_NAME}" />
						<input type="hidden" name="act" value="{$ACTION_NAME}" />
						<input type="hidden" name="t" value="{$t}" />
						<input type="hidden" name="time_status" id="time_status" value="{$time_status}" />
						<input type="submit" class="ml10 true_btn select_btn" value="搜索" />
              
						<div class="dd  f_r">
			              <a id="qiehuan" href="javascript:void(0);" color: #2ea7e0; text-decoration: none;">切换{if $time_status eq 0}高级{else}简单{/if}查询</a>
			            </div>
					</div>
					
				</form>
			</div>
			
			
			
			<div class="blank1"></div>
			<div class="i_deal_list clearfix pl10 pr10 pt5 pb5">
			
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
			        <tbody>
			            <tr border="0" style="background-color:#00bef0; color:#fff; height:34px;">
							<th style="width:14%">时间</th>
							<th style="width:17%">操作类型</th>
							{if $t=="point"}
							<th style="width:14%">操作积分</th>
							{else}
							<th style="width:14%">操作金额</th>
							{/if}
							<th style="width:14%">结余</th>
							<th>备注</th>
						</tr>
						{foreach from=$list item=log key=key name="log"}
						 <tr class="item {if $key mod 2 eq 1}item_1{/if}" {if $smarty.foreach.log.last}style="border-bottom:0"{/if}>
							<td>{$log.create_time_ymd}</td>
							<td>{$log.title}</td>
							{if $t=="point"}
							<td>{if $log.point gt 0}<span class="f_gr">+{$log.point}</span>{elseif $log.point eq 0}{$log.point}{else}<span class="f_red">{$log.point}</span>{/if}</td>
							<td> {$log.account_point}</td>
							{else}
							<td>{if $log.money gt 0}<span class="f_gr">+{$log.money}</span>{elseif $log.money eq 0}{$log.money}{else}<span class="f_red">{$log.money}</span>{/if}</td>
							<td> {$log.account_money}</td>
							{/if}
							<td>{$log.memo}</td>
						</tr>
						{/foreach}
					</tbody>
				</table>
			
				<div class="pages">{$pages}</div>
			</div>				
		</div>		
	</div>
	<div class="inc_foot"></div>
</div>
<script type="text/javascript">
	jQuery(function(){
		{if $user_info.ips_acct_no neq ''}
		checkIpsBalance(0,{$user_info.id},function(result){
			if(result.pErrCode=="0000"){
				$(".J_u_money_0").html($(".J_u_money_0").html() + "+<span class='f_red '>" + result.pBalance +"</span>[绑]");
				$(".J_u_money_1").html($(".J_u_money_1").html() + "+<span class='f_red '>" + (parseFloat(result.pBalance) + parseFloat(result.pLock) + parseFloat(result.pNeedstl)) +"</span>[绑]");
				$(".J_u_money_2").html($(".J_u_money_2").html() + "+" + result.pLock +"[绑]");
			}
		});
		{/if}
	});
</script>